home *** CD-ROM | disk | FTP | other *** search
/ Trusted Irix /B 4.0.4 / Trusted-Irix B-4.0.1.iso / dist / eoe1.idb / usr / include / sys / flock.h.z / flock.h
C/C++ Source or Header  |  1992-04-03  |  2KB  |  59 lines

  1. /*    Copyright (c) 1984 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8. #ident    "$Revision: 3.4 $"
  9.  
  10. #ifndef __SYS_FLOCK_H__
  11. #define __SYS_FLOCK_H__
  12.  
  13. #include "sys/fcntl.h"
  14. #include "sys/sema.h"
  15.  
  16. #define INOFLCK        1    /* Inode is locked when reclock() is called. */
  17. #define SETFLCK        2    /* Set a file lock. */
  18. #define SLPFLCK        4    /* Wait if blocked. */
  19. #define SETBSDFLCK    8    /* Set a Berkeley record lock. */
  20.  
  21. #define USE_PID        1    /* use epid when cleaning locks        */
  22. #define IGN_PID        2    /* ignore epid when cleaning locks    */
  23.  
  24. /* file locking structure (connected to inode) */
  25.  
  26. #define l_end         l_len
  27. #define MAXEND      017777777777
  28.  
  29. struct    filock    {
  30.     struct    flock set;    /* contains type, start, and end */
  31.     union    {
  32.         int wakeflg;    /* for locks sleeping on this one */
  33.         struct {
  34.             short sysid;
  35.             short pid;
  36.         } blk;            /* for sleeping locks only */
  37.     }    stat;
  38.     sema_t    wakesem;
  39.     struct    filock *prev;
  40.     struct    filock *next;
  41. };
  42.  
  43. /* file and record locking configuration structure */
  44. /* record use total may overflow */
  45. struct flckinfo {
  46.     long recs;    /* number of records configured on system */
  47.     long reccnt;    /* number of records currently in use */
  48.     long recovf;    /* number of times system ran out of record locks. */
  49.     long rectot;    /* number of records used since system boot */
  50. };
  51.  
  52. #ifdef _KERNEL
  53.  
  54. extern struct flckinfo    flckinfo;
  55. extern struct filock    flox[];
  56.  
  57. #endif /* _KERNEL */
  58. #endif /* __SYS_FLOCK_H__ */
  59.